{% extends "common/base.side.html" %}

{% block title %}
    Permission List
{% endblock %}

{% block rcontent %}
    <div class="btn-toolbar">
        <div class="btn-group">
            {% url "addpermissionurl" as theaddpermissionurl %}
            <a class="btn btn-default {%if request.path = theaddpermissionurl%} active {%endif%}" href={{ theaddpermissionurl }}><span class="glyphicon glyphicon-edit"></span>新建权限</a>
            {% url "listpermissionurl" as thelistpermissionurl %}
            <a class="btn btn-default {%if request.path = thelistpermissionurl%} active {%endif%}" href={{ thelistpermissionurl }}><span class="glyphicon glyphicon-list"></span>权限列表</a>
        </div>
    </div>

    <hr/>

    <table class="table table-hover table-striped  table-bordered table-condensed">
        <tr>
            <th>权限名称</th>
            <th>URL</th>
            <th>操作</th>
        </tr>

        {% for i in lPage %}
            <tr style="font-size: 13px;">
                <td>{{ i.name }}</td>
                <td>{{ i.url }}</td>

                <td>
                    <a href={% url "editpermissionurl" i.id %} onclick="return confirm('确认编辑权限吗？？')"><span class="glyphicon glyphicon-edit btn-xs"></span></a>
                    <a href={% url "deletepermissionurl" i.id %} onclick="return confirm('确认删除权限吗？？')"><span class="glyphicon glyphicon-trash btn-xs"></span></a>
                </td>
            </tr>
        {% endfor %}

    </table>

    {% include "common/paginator.html" %}
{% endblock %}
